f <- function() { 

a <- 1:3
a[c(3, 3, 1)] <- c(42, 43, 12)

}

f()
